package com.hao.servlet;
import  com.hao.service.workservice;
import  com.hao.serviceImpl.workserviceImpl;
import  com.hao.entity.work;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import com.alibaba.fastjson.JSON;
/**
 * Created by Administrator on 2018/8/8.
 */
public class findwork extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html;charset=utf-8");
        request.setCharacterEncoding("utf-8");
        PrintWriter out = response.getWriter();

        workservice se= new workserviceImpl();
        List<work> list=se.find();

        String json=JSON.toJSONString(list);
        out.print(json);
        out.flush();
        out.close();
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            doPost(request,response);
    }
}
